function add0(m) {
  return m < 10 ? "0" + m : m;
}
function format(shijianchuo) {
  //shijianchuo是整数，否则要parseInt转换
  var time = new Date(shijianchuo);
  var y = time.getFullYear();
  var m = time.getMonth() + 1;
  var d = time.getDate();
  var h = time.getHours();
  var mm = time.getMinutes();
  var s = time.getSeconds();
  return (
    y +
    "-" +
    add0(m) +
    "-" +
    add0(d) +
    " " +
    add0(h) +
    ":" +
    add0(mm) +
    ":" +
    add0(s)
  );
}

var shijian = {
  timeDate: function() {
    var val = new Date();
    var arr = [format(val)];
    var nowTime = val.getTime();
    var oneDayTime = 24 * 60 * 60 * 1000;
    for (let index = 1; index <= 14; index++) {
      var a = nowTime + index * oneDayTime;
      var b = new Date(a).getDay();
      if (b == 6 || b == 0) {
        // console.log();
      } else {
        arr.push(format(a));
      }
    }
    return arr.slice(0, 8);
  }
};

export default shijian.timeDate;
